<%-- 
    Document   : index
    Created on : 19 nov. 2010, 14:05:56
    Author     : maboisba
--%>

<%@page import="beans.ListeArticle"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Accueil</title>
  </head>
  <body>
    <center>
      <h1>Bienvenue sur le site de vente en ligne</h1>
      <table BORDER="1">
        <caption> Liste des articles disponibles </caption>
        <tr>
          <th width=150> ID </th>
          <th width=150> Nom </th>
          <th width=150> Description </th>
          <th width=150> Prix </th>
          <th width=150> Quantité désirée </th>
        </tr>
        <%
                  ListeArticle articles = (ListeArticle) request.getAttribute("articles");
                  java.util.Iterator<beans.Article> it = articles.getListeArticles().iterator();
                  System.out.println(articles.getListeArticles().size());
                  while (it.hasNext()) {
                    beans.Article article = it.next();
                    out.println("<tr>");
                    out.println("<td align=center>" + article.getId() + "</td>");
                    out.println("<td align=center>" + article.getNom() + "</td>");
                    out.println("<td align=center>" + article.getDescription() + "</td>");
                    out.println("<td align=center>" + article.getPrix() + " €</td>");
                    out.println("<td align=center><input type=text default=0/>");
                    out.println("</tr>");
                  }
        %>
      </table>
      <input type='submit' value='Commander'/>;
    </center>
  </body>
</html>
